{extend name="wap/default_new/Shop/shopBase" /}

{block name="resources"}
<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/control_type.css">
<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/goods_list.css">
<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/shop_index.css">
<script type="text/javascript" src="__TEMP__/{$style}/public/js/collection_goods_or_shop.js"></script>
<script type="text/javascript" src="__TEMP__/{$style}/public/js/shop_index.js"></script>


<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/goods_list.css">



<link rel="stylesheet" type="text/css" href="__TEMP__/{$style}/public/css/spelling_list.css">

<script src="__TEMP__/{$style}/public/js/public_assembly.js" type="text/javascript"></script>
<style>
    .user-info-box {
        display: inline-block;
        height: 68px;
        line-height: 68px;
        width: 68px;
        text-align: center;
        vertical-align: top;
    }

    .user-logo-shop {
        display: inline-block !important;
        vertical-align: middle !important;
        max-width: 100% !important;
        max-height: 100% !important;
        height: auto !important;
    }
    .custom-search .custom-search-input{
        border-radius: 18px !important;
        border:0 !important;
        background: hsla(0,0%,100%,.4);
        color: #fff !important;
    }
    .custom-search .custom-search-input::-webkit-input-placeholder, .custom-search .custom-search-input::-webkit-input-placeholder {
        color: #fff;
    }
    .shop-name-href{
		color:#FFF;
    }
</style>

{/block}

{block name="goodsHead"}
{if condition="$onekey_subscribe.url != ''AND $is_subscribe eq 0"}
<div class="fixed-focus-on">
    <i class="close" onclick="$('.fixed-focus-on').hide();">x</i>
    <div class="foucs-on-block">
        {if condition="$shop_info['shop_logo'] !=''"}
        <img class="user-bg" src="{$shop_info['shop_logo']}">
        {else/}
        <img class="user-bg" src="__TEMP__/{$style}/public/images/default/default_shop_avatar.png">
        {/if}
        {if condition="$source_user_name !=''"}
        <p>{:lang('i_am_your_best_friend')}<span>{$source_user_name}</span>,{:lang('recommended_to_you_business_from_now')}
        </p>
        <button onclick="location.href='{$onekey_subscribe.url}'">{:lang('click_on_the_attention')}</button>
        {else/}
        <p>
            {:lang('you_are_not_currently_concerned_about_the_WeChat_public_account')}，{:lang('click_on_the_attention')}</p>
        <button onclick="location.href='{$onekey_subscribe.url}'">{:lang('click_on_the_attention')}</button>
        {/if}
    </div>
</div>
{/if}
<!-- 轮播图 -->
<article class="user-head">


    <!-- {if condition="$shop_info['shop_avatar'] !=''"}
    <img class="user-bg" src="__UPLOAD__/{$shop_info['shop_avatar']}">
    {else/}
    <img class="user-bg" src="__TEMP__/{$style}/public/images/default/default_shop_avatar.png">
    {/if} -->
    <div style="width: 100%;background-color: rgb(255, 73, 94);padding: 12px 0;">
        {include file='wap/default_new/Shop/search'/}
    </div>
    <div class="user-info">
        <img class="shop_bg" src="{:__IMG($shop_info['shop_bg'])}" alt="">
        <div class="shop_box">
            <div class="user-info-box">
                {if condition="$shop_info['shop_avatar'] !=''"}
                <img class="user-logo-shop" src="{:__IMG($shop_info['shop_avatar'])}">
                {else/}
                <img class="user-logo-shop" src="{:__IMG($default_shop_img)}">
                {/if}
            </div>
            <h1><a class="shop-name-href" href="{:__URL('APP_MAIN/shop/shopDetail?shop_id='.$shop_id)}">{$shop_info['shop_name']}</a><br>已经有{$fav_count}人收藏</h1>
            <div class="click_fav" onclick="collectionGoodsOrShop('.js-collection',{$shop_id},'shop','')">
                {if condition="$is_member_fav_shop ==0"}
                <i class="fa fa-heart-o fav_icon"></i><span class="js-collection">{:lang('mark_shop')}</span>
                {else/}
                <i class="fa fa-heart fav_icon"></i><span class="js-collection">{:lang('goods_collected')}</span>
                {/if}
            </div>
        </div>
        <div class="shop-signs-mask"></div>
    </div>

    <div class="user-nav js-user-nav">
        <ul>
            <li><a href="{:__URL('APP_MAIN/shop/goodslist?shop_id='.$shop_id)}"><i class="nav-icon"><img src="__TEMP__/{$style}/public/images/shop/all_goods.png" alt=""></i>{:lang('all_goods')}</a>
            </li>
            <li><a href="{:__URL('APP_MAIN/shop/goodslist?shop_id='.$shop_id.'&type=3')}"><i class="nav-icon"><img src="__TEMP__/{$style}/public/images/shop/recommend.png" alt=""></i>推荐</a>
            </li>
            <li><a href="{:__URL('APP_MAIN/shop/goodslist?shop_id='.$shop_id.'&type=1')}"><i class="nav-icon"><img src="__TEMP__/{$style}/public/images/shop/new.png" alt=""></i>新品</a>
            </li>
            <li><a href="{:__URL('APP_MAIN/shop/goodslist?shop_id='.$shop_id.'&type=2')}"><i class="nav-icon"><img src="__TEMP__/{$style}/public/images/shop/hot.png" alt=""></i>热卖 </a>
            </li>
        </ul>
    </div>
</article>
{/block}

{block name="main" }
<div style="display:none;position: fixed;left: 10px;z-index: 999999;top:25%;border-radius: 100%;height:30px;width:30px;line-height: 30px;text-align: center;">
    <a href="{:__URL('APP_MAIN')}" style="color: #ffffff;">
        <img src="__TEMP__/{$style}/public/images/shop_goback.png"/>
    </a>
</div>
<input type="hidden" id="shop_id" value="{$shop_info['shop_id']}">
<input type="hidden" id="hidden_shop_id" value="{$shop_info['shop_id']}">

<script>var is_member_fav_shop = "{$is_member_fav_shop}";</script>
<div class="com-content">

    <style type="text/css">.custom-search-button {
        top: 1px !important;
    }</style>

    {include file='wap/default_new/Shop/notice'/}

	<!-- 优惠券领取 -->
	{if condition="!empty($coupon_list)"}
	{include file='wap/default_new/Index/controlCoupon'/}
	{/if} 
	<!-- 限时折扣 -->
	{if condition="!empty($discount_list)"}
	{include file='wap/default_new/Index/controlDiscount'/}
	{/if}
	
	<!-- 拼团 -->
	{if condition="$is_support_pintuan == 1"}
	{niu:gettuangougoodslist  name="list" page="1" num="5" where="npg.is_open=1 and npg.is_show=1 and npg.shop_id=$shop_id" order="npg.create_time desc"}
	{if condition="$list.data"}
	<div class="spelling-block">
		<header>
			<h3>拼团推荐</h3>
			<a href="{:__URL('APP_MAIN/goods/spellingGroupZone?shop_id='.$shop_id)}">查看更多</a>
		</header>
		<ul>
			{foreach name="$list.data" item="vo" key="k"}
			<li onclick="location.href='{:__URL('APP_MAIN/goods/goodsdetail?id='.$vo.goods_id)}'">
				<div>
					<img src="{:__IMG($default_goods_img)}" class="lazy_load pic" data-original="{:__IMG($vo.pic_cover_mid)}">
				</div>

				<footer>
					<p>{$vo.goods_name}</p>
					<div>
						<span class="tuangou-money">￥{$vo.tuangou_money}</span><br>
						<span class="original-money">单买价&nbsp;{$vo.promotion_price}元</span>
						<button>去拼单&nbsp;&gt;</button>
					</div>
				</footer>
			</li>
			{/foreach}
		</ul>
	</div>
	{/if}
	{/niu:gettuangougoodslist}
	{/if}
	
	
    {if condition="!empty($recommend_block)"}
    {foreach name = "recommend_block" item="recommend_item" key = "k"}
    {if condition="!empty($recommend_item['goods_list'])"}
    <div class="control">
        <div class="control_l">
            <!-- <span class="control_l_img"><img src="__TEMP__/{$style}[images]" alt="" /></span> -->
            <h1><i></i>{$recommend_item.class_name}<i></i></h1>
        </div>
    </div>
    <section class="members_goodspic">
        <ul>
            {foreach name = "recommend_item['goods_list']" item="goods"}
            <li class="gooditem">
                <div class="imgs">
                    <a href="{:__URL('APP_MAIN/Goods/goodsDetail?id='.$goods['goods_id'].'&shop_id='.$goods['goods_info']['shop_id'])}"><img
                            src="{:__IMG($default_goods_img)}" class="lazy_load"
                            data-original="{:__IMG($goods['picture_info']['pic_cover_mid'])}"></a>
                </div>
                <div class="info">
                    <p class="goods-title"><a
                            href="{:__URL('APP_MAIN/Goods/goodsDetail?id='.$goods['goods_info']['goods_id'])}">{$goods['goods_info']['goods_name']}</a>
                    </p>
                    <p class="goods-price"><em>￥{$goods['goods_info']['promotion_price']}</em></p>
                    <a href="javascript:CartGoodsInfo({$goods['goods_info']['goods_id']},{$goods['goods_info']['state']})">
                        <div class="goods-buy"></div>
                    </a>
                </div>
            </li>
            {/foreach}
        </ul>
    </section>
    {/if}
    {/foreach}
    {/if}
    <div class="h60"></div>

</div>
{include file='wap/default_new/share'/}
<script>
    $(function () {
        img_lazyload();
        $.ajax({
            type: "post",
            url: "{:__URL('APP_MAIN/shop/getsharecontents')}",
            data: {
                'shop_id': $("#shop_id").val()
            },
            success: function (data) {
                //alert(JSON.stringify(data));
                /* $("#share_title").val(data['share_title']);
                 $("#share_desc").val(data['share_contents']);
                 $("#share_url").val(data['share_url']);
                 $("#share_img_url").val(data['share_img']);\ */
                wx.config({
                    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                    appId: $("#appId").val(), // 必填，公众号的唯一标识
                    timestamp: $("#jsTimesTamp").val(), // 必填，生成签名的时间戳
                    nonceStr: $("#jsNonceStr").val(), // 必填，生成签名的随机串
                    signature: $("#jsSignature").val(),// 必填，签名，见附录1
                    jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
                });
                wx.ready(function () {
                    var title = data['share_title'];
                    var share_contents = data['share_contents'] + '\r\n';
                    var share_nick_name = data['share_nick_name'] + '\r\n';
                    var desc2 = share_contents + share_nick_name + "{:lang('heat_collection')}：★★★★★";
                    var url = data['share_url'];
                    var img_url = data['share_img'];
                    wx.onMenuShareAppMessage({
                        title: title,
                        desc: desc2,
                        link: url,
                        imgUrl: img_url,
                        trigger: function (res) {
//			                alert('用户点击发送给朋友');
                        },
                        success: function (res) {
//			                alert('已分享');

                        },
                        cancel: function (res) {
                            //alert('已取消');
                        },
                        fail: function (res) {
                            //alert(JSON.stringify(res));
                        }
                    });

                    // 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
                    wx.onMenuShareTimeline({
                        title: title,
                        link: url,
                        imgUrl: img_url,
                        trigger: function (res) {
                            // alert('用户点击分享到朋友圈');
                        },
                        success: function (res) {
                            //alert('已分享');

                        },
                        cancel: function (res) {
                            //alert('已取消');
                        },
                        fail: function (res) {
                            //     alert(JSON.stringify(res));
                        }
                    });

                    // 2.3 监听“分享到QQ”按钮点击、自定义分享内容及分享结果接口
                    wx.onMenuShareQQ({
                        title: title,
                        desc: desc2,
                        link: url,
                        imgUrl: img_url,
                        trigger: function (res) {
                            //alert('用户点击分享到QQ');
                        },
                        complete: function (res) {
                            //alert(JSON.stringify(res));
                        },
                        success: function (res) {
                            //alert('已分享');

                        },
                        cancel: function (res) {
                            //alert('已取消');
                        },
                        fail: function (res) {
                            //alert(JSON.stringify(res));
                        }
                    });

                    // 2.4 监听“分享到微博”按钮点击、自定义分享内容及分享结果接口
                    wx.onMenuShareWeibo({
                        title: title,
                        desc: desc2,
                        link: url,
                        imgUrl: img_url,
                        trigger: function (res) {
                            //alert('用户点击分享到微博');
                        },
                        complete: function (res) {
                            //alert(JSON.stringify(res));
                        },
                        success: function (res) {
                            //alert('已分享');

                        },
                        cancel: function (res) {
                            //alert('已取消');
                        },
                        fail: function (res) {
                            //alert(JSON.stringify(res));
                        }
                    });


                })

            }
        })

        $(".user-logo").next().css("padding-left", (parseInt($(".user-logo").width()) + 10) + "px");
    })
</script>


{/block}